package com.pc.tas.page;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface PageMapper {
	
	@Insert("insert into tas_page (id,pageName, parentId, attrs,hasChildren) values (#{id},#{pageName},#{parentId},#{attrs},#{hasChildren})")
	public void insert(Page page);
	
	@Update("update tas_page set pageName = #{pageName}, parentId = #{parentId}, attrs = #{attrs},hasChildren = #{hasChildren} where id = #{id}")
	public void update(Page page);
	
	@Delete("delete from tas_page where id = #{id}")
	public void delete(String id);
	
	@Select("select * from tas_page where id = #{id}")
	public Page getById(String id);
	
	@Select("select * from tas_page where parentid = #{parentId}")
	public List<Page> getByParentId(String parentId);
}
